var treeData = [
  {
    ID: "叶晓华",
    NAME: '应急指挥官',
    value: '13601550500',
    children: [
      // {
      //   ID: '张杰',
      //   NAME: '指挥官助理',
      //   value: '13962195346',
      //   children: []
      // },
      {
        ID: '吴文彪',
        NAME: '急救组组长',
        children: [
          {
            ID: '朱建文',
            NAME: '组员',
            value: '13606211619'
          }, {
            ID: '陈洪',
            NAME: '组员',
            value: '15962107732'
          },

        ],
      },

      {
        ID: '陆静波',
        NAME: '交通管制组组长',
        value: '13912646638',

        children: [
          {
            ID: "陆建元",
            NAME: '组员',
            value: '15962110805'
          },
          {
            ID: '钱国良',
            NAME: '组员',
            value: '13913134502'
          },

        ],
      },


      {
        ID: '钱宗明',
        NAME: '后勤支援组组长',
        children: [
          {
            ID: "俞磊",
            NAME: '组员',
            value: '13915556452'

          },
          {
            ID: '沈文华',
            NAME: '组员',
            value: '13861337386'

          },

        ],
      },


      {
        ID: '范丽亚',
        NAME: '医疗救护组组长',
        children: [
          {
            ID: "毛一平",
            NAME: '组员',
            value: '15195803586'

          },
          {
            ID: '徐钰男',
            NAME: '组员',
            value: '13962177500'

          },

        ],
      },


    ],
  },
]
const option = {


  tooltip: {
    position: ['50%', '50%'],
    show: true,
    backgroundColor: '#101E44',
    textStyle: {
      color: 'fff'
    },
    formatter: function (param) {
      //return '<em style="color:' + param.color + ';">' + param.value + '</em> 分'
      if (param.value) {
        return '<span style="color:#ffffff;">姓名:' + param.data.ID + "<br/>职位：" + param.data.NAME + "<br/>手机号:" + param.value + '</span> '
      } else {
        return '<span style="color:#ffffff;">姓名:' + param.data.ID + "<br/>职位：" + param.data.NAME + '</span> '
      }
    }
  },
  series: [
    {
      type: 'tree',
      edgeShape: 'polyline', // 链接线是折现还是曲线
      orient: 'TB',
      roam: true,
      data: treeData,
      width: '95%',
      height: '75%',
      left: '5%',
      right: '5%',
      top: '8%',
      bottom: '1%',
      symbolSize: 2,
      initialTreeDepth: 4,
      label: {
        normal: {
          position: 0,
          align: 'center',
          padding: [10, 20],
          fontWeight: 'bold',
          formatter: function (param) {
            let NAME =
              param.data.NAME.substring(0, 8) +
              '\n' +
              param.data.NAME.substring(8, 16) +
              '\n' +
              param.data.NAME.substring(16);
            // return [`{img|}`, `{VALUE|${param.data.ID}}`, `{NAME|${NAME}}`].join('\n');
            return [`{img|}`, `{VALUE|${param.data.ID}}`, `{NAME|${param.data.NAME}}`, `{PHONE|${param.data.value || ''}}`].join('\n');

          },
          rich: {
            img: {
              backgroundColor: {
                image: ''
              },
              width: 60,
              height: 53,
            },
            VALUE: {
              color: '#4cE4E6',
              fontSize: 15,
              fontFamily: 'DIN',
              verticalAlign: 'top',
              position: 'top',
              width: 80,
              padding: [1, 50],
            },

            NAME: {
              color: '#fff',
              fontSize: 12,
              width: 80,
              padding: [1, 50],
            },
            PHONE: {
              color: '#fff',
              width: 150,
              fontSize: 12,
              verticalAlign: 'top',
              padding: [0, 50],
            },
          },
        },
      },
      lineStyle: {
        color: '#158387',
      },
      expandAndCollapse: true,
      animationDuration: 550,
      animationDurationUpdate: 750,
    },
  ],
};


export default option
